<head th:fragment="headerCss">
    <meta charset="utf-8">
    <title>湖南金职伟业母婴护理有限公司</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta name="keywords" content=""/>
    <meta name="description"
          content="湖南金职伟业母婴护理有限公司"/>
    <link rel="stylesheet" href="/js/layui/css/layui.css">
    <!-- Bootstrap CSS File -->
    <!--<link href="/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">-->
    <link rel="stylesheet" href="/css/examination/common.css">
    <link href="/css/font-awesome.css?v=4.4.0"
          th:href="@{/css/font-awesome.css?v=4.4.0}" rel="stylesheet">
    <!-- Google Fonts -->
    <link rel="shortcut icon" href="favicon.ico">
    <style>
        .ti1{float: left;width: 20%;line-height: 42px;color: #666}
        .ti2{float: left;width: 80%}
    </style>
</head>
<body class="signin">
<div class="header">
    <a href="javascript:;" class="logo">
        <img src="/img/logo2.png" style="width:217px;height:49px" alt="logo">
        <!--<p>1+X证书制度试点工作</p>-->
        <p id="title">课后同步练习</p>
    </a>
</div>
<div class="main_content has_back">
    <div class="window_box">
        <div class="toptit"><label>学生登录</label></div>
        <div class="loginIn">
            <div class="item">
                <label class="ti1">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</label>
                <input  type="text" id="username" placeholder="请输入姓名" autocomplete="new-password" class="ti2 layui-input">
                <div style="clear: both"></div>
            </div>
            <div class="item">
                <label class="ti1">身份证号</label>
                <input type="text" id="idCard" placeholder="请输入身份证号" autocomplete="new-password" class="ti2 layui-input">
                <div style="clear: both"></div>
            </div>
            <div class="item">
                <label class="ti1">准考证号</label>
                <input type="text" id="ticketNumber" placeholder="请输入准考证号" autocomplete="new-password"
                       class="ti2 layui-input">
                <div style="clear: both"></div>
            </div>
            <!--<div class="item" style="text-align: right">-->
                <!--<label ><a href="/examination/abnormal">考试异常恢复</a></label>-->
            <!--</div>-->
            <div class="item">
                <input type="hidden" th:value="${time}" id="times" />
                <input type="hidden" th:value="${dates}" id="dates" />
                <a href="javascript:;" class="layui-btn layui-btn-fluid layui-btn-danger" onclick="login()"
                   id="submitBtn">登 录</a>
            </div>
        </div>
    </div>
</div>
<script src="/js/jquery.min.js?v=2.1.4" th:src="@{/js/jquery.min.js?v=2.1.4}"></script>
<script src="/js/plugins/layer/layer.min.js" th:src="@{/js/plugins/layer/layer.min.js}"></script>
<script type="text/javascript">
    //回车登录
    document.onkeydown =cdk;
    function cdk(){
        if(event.keyCode ==13){
            login();
        }
    }
    // var id=null;
    // $(function () {
    //     $.ajax({
    //         url: "/jzApi/examinations/selExamination",
    //         async : false,
    //         success: function (r) {
    //            //console.log("r",r)
    //             if(r.code !=-1){
    //                 if(window.localStorage){
    //                     window.localStorage.setItem("intro",JSON.stringify(r.data));
    //                      window.localStorage.setItem("backGroundImage",r.data.backGroundImage);
    //                 }else{
    //                     layer.msg("请换浏览器，最佳为谷歌")
    //                 }
    //                 $("#title").html(r.data.name+' | 在线考试');
    //                 id = r.data.id
    //             }else{
    //                 $("#title").html('暂无在线考试');
    //             }
    //         }
    //     });
    // });
    function login() {
        var username = $("#username").val();
        var idCard = $("#idCard").val();
        var ticketNumber = $("#ticketNumber").val();
        if ('' == username) {
            layer.msg('请输入姓名');
            return false
        }
        if ('' == idCard) {
            layer.msg('请输入身份证号');
            return false
        }
        if ('' == ticketNumber) {
            layer.msg('请输入准考证号');
            return false
        }
        $.ajax({
            type: "POST",
            url:"/jzApi/examinations/loginExamination",
            data: {id:id,name:username , idCard:idCard, ticketNumber:ticketNumber},
            success: function (r) {
                //console.log("map =" , r.data.endDate);
                if (r.code == 0) {
                    if(window.localStorage){
                        window.localStorage.setItem("info",JSON.stringify(r.data));
                        window.localStorage.setItem("times",JSON.stringify($('#times').val()));
                        window.localStorage.setItem("dates",JSON.stringify($('#dates').val()));
                    }else{
                        layer.msg("请换浏览器，最佳为谷歌")
                    }
                    location.href = '/examination/startExam'
                } else {
                    layer.msg(r.msg);
                }
            }
        });
    }
</script>
</body>





